<?php if(!defined('PUBLIC_DIR')) die('No Access!');

using('System.Data.Sql');

abstract class Repair implements iRepair{
	public static function Configuration(){
		$DBHandler = new Database(Config::Get('confg.store.path') . Config::Get('confg.store.filename'), Config::Get('confg.store.type'), true);
		$DBHandler->Query('CREATE TABLE [Config] (name VARCHAR(255), value VARCHAR(255));');
		//$DBHandler->Query("INSERT INTO [Config] (name, value) VALUES ('$Namespace', '$Value');");
		$DBHandler->Query('CREATE TABLE [Events] (name VARCHAR(255), handle VARCHAR(255));');
		//$DBHandler->Query("INSERT INTO [Events] (name, handle) VALUES ('App.Unload', 'App::Unload');");
		$DBHandler->Query('CREATE TABLE [Traces] (name VARCHAR(255), pattern VARCHAR(255), conditions VARCHAR(255), event VARCHAR(255));');
		//$DBHandler->Query("INSERT INTO [Traces] (name, pattern, conditions, event) VALUES ('article_show', '/article/:id/show', '', 'articleShow');");
		$DBHandler->Query('CREATE TABLE [Routes] (name VARCHAR(255), pattern VARCHAR(255), conditions VARCHAR(255), action VARCHAR(255), additionalParameters VARCHAR(255));');
		$DBHandler->Query("INSERT INTO [Routes] (name, pattern, conditions, action, additionalParameters) VALUES ('admin_show', '/admin', '', 'Components.Admin.AdminController::Show', '');");
		$DBHandler->Query("INSERT INTO [Routes] (name, pattern, conditions, action, additionalParameters) VALUES ('default_show', '/', '', 'Components.Default.DefaultController::Show', '');");
		$DBHandler->Close();
	}
}